|
In computer programming, scope is an enclosing context where values and expressions are associated. The scope resolution operator helps to identify and specify the context to which an identifier refers, particularly by specifying a namespace. The specific uses vary across different programming languages with the notions of scoping. In many languages the scope resolution operator is written "::". In some languages, notably those influenced by Modula-3, including Python and Go, modules are objects, and scope resolution within modules is a special case of usual object member access, so the usual method operator . is used for scope resolution. Other languages, notably C++ and Ruby, feature both scope resolution and method access, which interact in various ways; see examples below.== C++ == class A ; namespace B int A::i = 4; // scope operator refers to the integer i declared in the class A int B::j = 2; // scope operator refers to the integer j declared in the namespace B 抄文引用元・出典: フリー百科事典『 ウィキペディア(Wikipedia)』 ■ウィキペディアで「Scope resolution operator」の詳細全文を読む スポンサード リンク
|